package flc.ast.adapter;


import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.stark.picselect.entity.SelectMediaEntity;

import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class SelPictureShowAdapter extends StkProviderMultiAdapter<String> {


    public SelPictureShowAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new SelPictureShowProvider());
    }

    private class SelPictureShowProvider extends BaseItemProvider<String> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_sel_pic_show;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, String bean) {
            Glide.with(getContext()).load(bean)
                    .into((ImageView) baseViewHolder.getView(R.id.ivSelPicShowItemImg));
        }
    }

}
